How to complie testdisk?

1. Get source code from http://git.cgsecurity.org/testdisk.git
2. Exclude the following files in XCode:
    - fidentify.c
    - file_template.c
    - partgptro.c   // duplicated func "write_part_gpt"
    - phmain.c
    - qmainrec.cpp
    - qphotorec.cpp
    - qphotorec.qrc
    - qphbs.cpp
    - qphotorec.h
    - qpsearch.cpp
    - testdisk.c

3. Add the following define/include in xxx-Prefix.pch
#define TESTDISK_LSB
#define HAVE_STDLIB_H
#define HAVE_SNPRINTF
#define HAVE_VSNPRINTF
#define HAVE_MKDIR
#define HAVE_PWRITE
#define HAVE_UUID_GENERATE
#define HAVE_UUID_UUID_H
#define HAVE_PREAD
#include <time.h>
#include <sys/stat.h>
#include <unistd.h>
#include <fcntl.h>

4. Modify source code
(key word: [sendoh])
fat_unformat.c  // callback status
phbf.c          // callback status
phbs.c          // callback status
photorec.h      // add callback function
phrecn.c        // callback finish
psearchn.c      // callback status


